home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-09 | 2.6 KB | 90 lines | [TEXT/GEOL] |
- Item 0893345 6-Oct-89 21:19
-
- From: V0230 Trace, Laurence Kirsh,VAR
-
- To: KNEPPER Knepper, Christopher
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: Segment Mapping
-
- Chris,
-
- Yes, the linker's segment mappings are useful. You reminded me of a script I
- have to extract all of the -sn's from a MacApp MakeIt file. I have listed it
- below, in case it would be of any use to anyone.
-
- What I was thinking of when I wrote the note was the job of getting each method
- into the "right" segment. Of course, there aren't THAT many segments, and after
- a while you remember which methods go into which segments. Still, MacApp
- development could stand a lot of automation.
-
- For example, wouldn't it be great if your method overrides went into the
- inherited method's segment automatically? Wouldn't it be great if Fields
- methods were created automatically? Wouldn't it be great if the compiler knew
- which Toolbox routine did NOT move memory, so it wouldn't flag the parameters
- as "in danger"?....ah, well.
-
- Here is my script to produce a legible listing of segment mappings from a
- MacApp MakeIt file. Put it in a file, and simply execute it:
-
-
- ######################################################
- # 'SN Stripper'
- # A simple script to change link synonyms from a
- # "MakeIt" file into a legible list of the same.
- #
- # If there are any linker options in the middle of the list of
- # -sn options (usually caused by adding -sn options to your own
- # MAMake file) they should just go along for the ride.
- # If they cause errors, rearrange them in your MAMake file.
-
- set MISuffix "-sn" #our new file's suffix
-
- #get makeit file, open it as target (we won't save changes)
- set Exit 0
- unset MIFile
- set MIFile `GetFileName -t TEXT -m "Select a MakeIt file"` ≥ Dev:Null
- if {Status} != 0
- set Exit 1
- echo "Script Cancelled"
- exit
- end
- open -t "{MIFile}"
-
- #delete all through first Link -sn
- find •
- find /∂"Linking:/
- find /∂-sn /
- clear §:•
-
- #find last -sn, delete everything after it, add final CR
- find -c ∞ /-sn/
- find /=[A-Za-z0-9]+/Δ #check for more characters?
- clear §:∞
- replace § "∂n"
-
- #break each -sn onto a separate line, remove any ∂s
- find •
- replace -c ∞ / ∂-sn / ∂n
- find •
- replace -c ∞ /[ ∂t]*∂∂/ ""
-
- #swap "G" names on left of "=" with "A" names on right:
- find •
- replace -c ∞ /(≈)®1∂=(≈)®2∂n/ '®2=®1'∂n
-
- #sort by "G" names
- sort "{Target}" > "{MIFile}{MISuffix}"
-
- #close original file WITHOUT saving changes, open new one, resize it
- close -n "{Target}"
- open -t "{MIFile}{MISuffix}"
- sizewindow 230 305
-
- Set Exit 1
- ###############################################
-
- -John MacVeigh
-
-